.class public Les/m00;
.super Ljava/lang/Object;
.source "LockManager.java"


# static fields
.field private static d:Les/m00;


# instance fields
.field private final a:Les/j00;

.field private b:[Ljava/lang/String;

.field private c:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Les/k00;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method static constructor <clinit>()V
    .locals 0

    return-void
.end method

.method private constructor <init>()V
    .locals 4

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    new-instance v0, Ljava/util/concurrent/CopyOnWriteArrayList;

    invoke-direct {v0}, Ljava/util/concurrent/CopyOnWriteArrayList;-><init>()V

    iput-object v0, p0, Les/m00;->c:Ljava/util/List;

    .line 3
    invoke-static {}, Les/j00;->b()Les/j00;

    move-result-object v0

    iput-object v0, p0, Les/m00;->a:Les/j00;

    const/4 v0, 0x1

    new-array v1, v0, [Ljava/lang/String;

    const-string v2, "locked"

    const/4 v3, 0x0

    aput-object v2, v1, v3

    new-array v2, v0, [Ljava/lang/String;

    .line 4
    iput-object v2, p0, Les/m00;->b:[Ljava/lang/String;

    .line 5
    invoke-static {v1, v3, v2, v3, v0}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    return-void
.end method

.method public static declared-synchronized b()Les/m00;
    .locals 2

    const-class v0, Les/m00;

    monitor-enter v0

    .line 1
    :try_start_0
    sget-object v1, Les/m00;->d:Les/m00;

    if-nez v1, :cond_0

    .line 2
    new-instance v1, Les/m00;

    invoke-direct {v1}, Les/m00;-><init>()V

    sput-object v1, Les/m00;->d:Les/m00;

    .line 3
    :cond_0
    sget-object v1, Les/m00;->d:Les/m00;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit v0

    return-object v1

    :catchall_0
    move-exception v1

    monitor-exit v0

    throw v1
.end method

.method private c(Les/k00;)Les/k00;
    .locals 4

    .line 1
    invoke-virtual {p1}, Les/l00;->a()Ljava/lang/String;

    move-result-object v0

    const/4 v1, 0x0

    .line 2
    :try_start_0
    iget-object v2, p0, Les/m00;->a:Les/j00;

    invoke-virtual {v2}, Les/j00;->a()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v2
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    if-nez v2, :cond_0

    return-object v1

    .line 3
    :cond_0
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "lockname = \""

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v0, "\""

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 4
    iget-object v1, p0, Les/m00;->a:Les/j00;

    iget-object v2, p0, Les/m00;->b:[Ljava/lang/String;

    const-string v3, "lock"

    invoke-virtual {v1, v3, v2, v0}, Les/j00;->a(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0

    .line 5
    invoke-interface {v0}, Landroid/database/Cursor;->getCount()I

    move-result v1

    if-eqz v1, :cond_3

    .line 6
    invoke-interface {v0}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v1

    if-eqz v1, :cond_3

    :cond_1
    const-string v1, "locked"

    .line 7
    invoke-interface {v0, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    const/4 v2, 0x0

    const/4 v3, 0x1

    if-ne v1, v3, :cond_2

    goto :goto_0

    :cond_2
    const/4 v3, 0x0

    :goto_0
    invoke-virtual {p1, v3, v2}, Les/k00;->b(ZZ)V

    .line 8
    invoke-interface {v0}, Landroid/database/Cursor;->moveToNext()Z

    move-result v1

    if-nez v1, :cond_1

    .line 9
    :cond_3
    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    .line 10
    iget-object v0, p0, Les/m00;->a:Les/j00;

    invoke-virtual {v0}, Les/j00;->close()V

    return-object p1

    :catch_0
    move-exception p1

    .line 11
    invoke-static {}, Lcom/estrongs/android/statistics/b;->b()Lcom/estrongs/android/statistics/b;

    move-result-object v0

    const-string v2, "lockdb"

    invoke-virtual {v0, v2, p1}, Lcom/estrongs/android/statistics/b;->a(Ljava/lang/String;Ljava/lang/Throwable;)V

    return-object v1
.end method


# virtual methods
.method public a(Ljava/lang/String;)Les/k00;
    .locals 3

    .line 2
    iget-object v0, p0, Les/m00;->c:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :cond_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_1

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Les/k00;

    .line 3
    invoke-virtual {v1}, Les/l00;->a()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_0

    goto :goto_0

    :cond_1
    const/4 v1, 0x0

    :goto_0
    return-object v1
.end method

.method public a()Ljava/util/List;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List<",
            "Les/k00;",
            ">;"
        }
    .end annotation

    .line 1
    iget-object v0, p0, Les/m00;->c:Ljava/util/List;

    return-object v0
.end method

.method public a(Les/k00;)V
    .locals 1

    .line 4
    invoke-direct {p0, p1}, Les/m00;->c(Les/k00;)Les/k00;

    move-result-object p1

    if-eqz p1, :cond_0

    .line 5
    iget-object v0, p0, Les/m00;->c:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    :cond_0
    return-void
.end method

.method public b(Les/k00;)V
    .locals 1

    .line 7
    iget-object v0, p0, Les/m00;->a:Les/j00;

    invoke-virtual {v0}, Les/j00;->a()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    if-nez v0, :cond_0

    return-void

    .line 8
    :cond_0
    iget-object v0, p0, Les/m00;->a:Les/j00;

    invoke-virtual {v0, p1}, Les/j00;->a(Les/k00;)Z

    .line 9
    iget-object p1, p0, Les/m00;->a:Les/j00;

    invoke-virtual {p1}, Les/j00;->close()V

    return-void
.end method

.method public b(Ljava/lang/String;)Z
    .locals 2

    .line 4
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    const/4 v1, 0x0

    if-eqz v0, :cond_0

    return v1

    .line 5
    :cond_0
    invoke-virtual {p0, p1}, Les/m00;->a(Ljava/lang/String;)Les/k00;

    move-result-object p1

    if-nez p1, :cond_1

    return v1

    .line 6
    :cond_1
    invoke-virtual {p1}, Les/l00;->c()Z

    move-result v0

    if-eqz v0, :cond_2

    invoke-virtual {p1}, Les/l00;->d()Z

    move-result p1

    if-eqz p1, :cond_2

    const/4 v1, 0x1

    :cond_2
    return v1
.end method
